/**
 * Created by Dalyn on 2017/3/28.
 */
import Relay from "react-relay";

export default class AddOrEditMaterielBillMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { addOrEditMaterielBill }`;
    }

    getVariables() {
        return {
            argsInput: {
                "bomId":this.props.bomId,
                "orderId":this.props.orderId,
                "goodsId":this.props.goodsId,
                "styleNo":this.props.styleNo,
                "materielType":this.props.materielType,
                "size":this.props.size,
                "productName":this.props.productName,
                "color":this.props.color,
                "description":this.props.description,
                "quantity":this.props.quantity,
                "dosage":this.props.dosage,
                "consume":this.props.consume,
                "needCount":this.props.needCount,
                "prickle":this.props.prickle,
                "partDesc":this.props.partDesc,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on addOrEditMaterielBillPayload {
            addOrEditMaterielBill {  
                errorCode
                value
                totalResult
                id
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on addOrEditMaterielBillPayload {
                    addOrEditMaterielBill {
                        errorCode
                        value
                        totalResult
                        id                         
                    }
                }
            `]
        }];
    }

}